<select class="form-control {{$class}}"
        style="display: none"
        data-style="btn-default"
        data-live-search="true"
        data-actions-box="true"
        name="{{$name}}{{$multiple ? '[]':''}}"
        id="{{$id}}"
{{$multiple ? 'multiple="multiple"':''}}
{{$disabled ? 'disabled="disabled"':''}}
{{$readonly && !$multiple ? 'onfocus="this.defaultIndex=this.value;" onchange="this.selectedIndex=this.defaultIndex;"':''}}>
{{foreach $list as $k=>$v}}
    {{if !$group}}
        {{if in_array($k,$value)}}
            <option value="{{$k}}" selected="selected">{{$v}}</option>
        {{else/}}
            <option value="{{$k}}">{{$v}}</option>
        {{/if}}
    {{else/}}
        <optgroup label="{{$k}}">
            {{foreach $v as $sk=>$sv}}
                {{if in_array($sk,$value)}}
                    <option value="{{$sk}}" selected="selected">{{$sv}}</option>
                {{else/}}
                    <option value="{{$sk}}">{{$sv}}</option>
                {{/if}}
            {{/foreach}}
        </optgroup>
    {{/if}}
{{/foreach}}
</select>
{{:builder_event_listen($js_hook, function () use($form_id,$id) {
return <<<HOOK
<script type='text/javascript'>
    $(document).ready(function () {
        $('#$id').selectpicker('render');
    });
</script>
HOOK;
})}}